package com.wangdao.mall.service;

import com.wangdao.mall.dao.UserDao;
import com.wangdao.mall.dao.UserDaoImp;
import com.wangdao.mall.model.Password;
import com.wangdao.mall.model.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author:HaiyangTian
 * @Description:
 * @Date: Created in 16:44 2020/4/30
 * @Modified By:
 */
public class UserServiceImp implements UserService{

    private UserDao userDao = new UserDaoImp();

    @Override
    public List<User> allUser() {
        return userDao.allUser();
    }

    @Override
    public int deleteUser(String id) {
        return userDao.deleteUser(id);
    }

    @Override
    public List<User> searchUser(String nickname) {
        return userDao.searchUser(nickname);
    }

    @Override
    public int login(User user) {
        return userDao.login(user);
    }

    @Override
    public int signup(User user) {
        return userDao.signup(user);
    }

    @Override
    public User getUserData(String token) {
        return userDao.getUserData(token);
    }

    @Override
    public void updateUserData(User user) {
        userDao.updateUserData(user);
    }

    @Override
    public int updatePwd(Password password) {
        return userDao.updatePwd(password);
    }
}
